<div class="accordion" id="accordionMatch">
		<?php foreach ($tournament["Match"] as $key => $match) { ?>
			<div class="accordion-group">
			    <div class="accordion-heading row">
			    	<div class="datetime col-md-12">
			      	    <?php echo CakeTime::format($match['date'], "%d/%m/%Y"). ' ' . $match['time']; ?>
			    	</div>
					<div class="col-md-2">
						<a href="<?php echo $this->webroot.Configure::read("Config.lang").'/matches/'.$tournament['Tournament']['country_slug'].'/'.$tournament['Tournament']['league_slug'].'/'.$tournament['Tournament']['season_slug'].'/'.$match['localteam_slug']; ?>">
					      	<img src="data:image/gif;base64,<?php echo isset($match['registryLocalteam']['image'])?$match['registryLocalteam']['image']:''; ?>" />
						</a>
					</div>
			    	<div class="col-md-8">
				      <a class="accordion-toggle" data-toggle="collapse" data-parent="#collapseT<?php echo $tournament['Tournament']['id']; ?>" href="#collapseM<?php echo $match['id']; ?>">
				      	<?php echo $match['localteam'].'   ['.$match['score_localteam'].'-'.$match['score_visitorteam'].']   '.$match['visitorteam']; ?>
				      </a>
			    	</div>
					<div class="col-md-2">
						<a href="<?php echo $this->webroot.Configure::read("Config.lang").'/matches/'.$tournament['Tournament']['country_slug'].'/'.$tournament['Tournament']['league_slug'].'/'.$tournament['Tournament']['season_slug'].'/'.$match['visitorteam_slug']; ?>">
					      	<img src="data:image/gif;base64,<?php echo isset($match['registryVisitorteam']['image'])?$match['registryVisitorteam']['image']:''; ?>" />
						</a>
					</div>
			    </div>
			    <div id="collapseM<?php echo $match['id']; ?>" class="accordion-body collapse">
			      <div class="accordion-inner row">
						<div class="col-md-12">
							<h3><?php echo __("Goal"); ?></h3>
					        <p><?php echo $this->element('event',array("events"=>$match["Event"])); ?></p>
						</div>
						<div class="col-md-12">
							<h3><?php echo __("Sostituzioni"); ?></h3>
							<div class="col-md-6">
						        <p><?php echo $this->element('substitution',array("substitutions"=>$match["Localteam_substitution"])); ?></p>
							</div>
							<div class="col-md-5">
						        <p><?php echo $this->element('substitution',array("substitutions"=>$match["Visitorteam_substitution"])); ?></p>
							</div>
			
					        
						</div>
						<div class="col-md-12">
							<h3><?php echo __("Formazioni"); ?></h3>
							<div class="col-md-6">
						        <p><?php echo $this->element('lineups',array("lineups"=>$match["Localteam"])); ?></p>
							</div>
							<div class="col-md-5">
				  		        <p><?php echo $this->element('lineups',array("lineups"=>$match["Visitorteam"])); ?></p>
							</div>
				        </div>
			      </div>
			    </div>
			</div>
		<?php } ?>
</div>